home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / X11 / extensions / Xrender.h < prev    next >
C/C++ Source or Header  |  2006-04-12  |  11KB  |  487 lines

  1. /*
  2.  *
  3.  * Copyright ⌐ 2000 SuSE, Inc.
  4.  *
  5.  * Permission to use, copy, modify, distribute, and sell this software and its
  6.  * documentation for any purpose is hereby granted without fee, provided that
  7.  * the above copyright notice appear in all copies and that both that
  8.  * copyright notice and this permission notice appear in supporting
  9.  * documentation, and that the name of SuSE not be used in advertising or
  10.  * publicity pertaining to distribution of the software without specific,
  11.  * written prior permission.  SuSE makes no representations about the
  12.  * suitability of this software for any purpose.  It is provided "as is"
  13.  * without express or implied warranty.
  14.  *
  15.  * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  16.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
  17.  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  18.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  19.  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
  20.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  *
  22.  * Author:  Keith Packard, SuSE, Inc.
  23.  */
  24.  
  25. #ifndef _XRENDER_H_
  26. #define _XRENDER_H_
  27.  
  28. #include <X11/extensions/render.h>
  29.  
  30. #include <X11/Xlib.h>
  31. #include <X11/Xfuncproto.h>
  32. #include <X11/Xosdefs.h>
  33. #include <X11/Xutil.h>
  34.  
  35. typedef struct {
  36.     short   red;
  37.     short   redMask;
  38.     short   green;
  39.     short   greenMask;
  40.     short   blue;
  41.     short   blueMask;
  42.     short   alpha;
  43.     short   alphaMask;
  44. } XRenderDirectFormat;
  45.  
  46. typedef struct {
  47.     PictFormat        id;
  48.     int            type;
  49.     int            depth;
  50.     XRenderDirectFormat    direct;
  51.     Colormap        colormap;
  52. } XRenderPictFormat;
  53.  
  54. #define PictFormatID        (1 << 0)
  55. #define PictFormatType        (1 << 1)
  56. #define PictFormatDepth        (1 << 2)
  57. #define PictFormatRed        (1 << 3)
  58. #define PictFormatRedMask   (1 << 4)
  59. #define PictFormatGreen        (1 << 5)
  60. #define PictFormatGreenMask (1 << 6)
  61. #define PictFormatBlue        (1 << 7)
  62. #define PictFormatBlueMask  (1 << 8)
  63. #define PictFormatAlpha        (1 << 9)
  64. #define PictFormatAlphaMask (1 << 10)
  65. #define PictFormatColormap  (1 << 11)
  66.  
  67. typedef struct _XRenderPictureAttributes {
  68.     Bool        repeat;
  69.     Picture        alpha_map;
  70.     int            alpha_x_origin;
  71.     int            alpha_y_origin;
  72.     int            clip_x_origin;
  73.     int            clip_y_origin;
  74.     Pixmap        clip_mask;
  75.     Bool        graphics_exposures;
  76.     int            subwindow_mode;
  77.     int            poly_edge;
  78.     int            poly_mode;
  79.     Atom        dither;
  80.     Bool        component_alpha;
  81. } XRenderPictureAttributes;
  82.  
  83. typedef struct {
  84.     unsigned short   red;
  85.     unsigned short   green;
  86.     unsigned short   blue;
  87.     unsigned short   alpha;
  88. } XRenderColor;
  89.  
  90. typedef struct _XGlyphInfo {
  91.     unsigned short  width;
  92.     unsigned short  height;
  93.     short        x;
  94.     short        y;
  95.     short        xOff;
  96.     short        yOff;
  97. } XGlyphInfo;
  98.  
  99. typedef struct _XGlyphElt8 {
  100.     GlyphSet            glyphset;
  101.     _Xconst char        *chars;
  102.     int                nchars;
  103.     int                xOff;
  104.     int                yOff;
  105. } XGlyphElt8;
  106.  
  107. typedef struct _XGlyphElt16 {
  108.     GlyphSet            glyphset;
  109.     _Xconst unsigned short  *chars;
  110.     int                nchars;
  111.     int                xOff;
  112.     int                yOff;
  113. } XGlyphElt16;
  114.  
  115. typedef struct _XGlyphElt32 {
  116.     GlyphSet            glyphset;
  117.     _Xconst unsigned int    *chars;
  118.     int                nchars;
  119.     int                xOff;
  120.     int                yOff;
  121. } XGlyphElt32;
  122.  
  123. typedef double    XDouble;
  124.  
  125. typedef struct _XPointDouble {
  126.     XDouble  x, y;
  127. } XPointDouble;
  128.  
  129. #define XDoubleToFixed(f)    ((XFixed) ((f) * 65536))
  130. #define XFixedToDouble(f)    (((XDouble) (f)) / 65536)
  131.  
  132. typedef int XFixed;
  133.  
  134. typedef struct _XPointFixed {
  135.     XFixed  x, y;
  136. } XPointFixed;
  137.  
  138. typedef struct _XLineFixed {
  139.     XPointFixed    p1, p2;
  140. } XLineFixed;
  141.  
  142. typedef struct _XTriangle {
  143.     XPointFixed    p1, p2, p3;
  144. } XTriangle;
  145.  
  146. typedef struct _XTrapezoid {
  147.     XFixed  top, bottom;
  148.     XLineFixed    left, right;
  149. } XTrapezoid;
  150.  
  151. typedef struct _XTransform {
  152.     XFixed  matrix[3][3];
  153. } XTransform;
  154.  
  155. typedef struct _XFilters {
  156.     int        nfilter;
  157.     char    **filter;
  158.     int        nalias;
  159.     short   *alias;
  160. } XFilters;
  161.  
  162. typedef struct _XIndexValue {
  163.     unsigned long    pixel;
  164.     unsigned short   red, green, blue, alpha;
  165. } XIndexValue;
  166.  
  167. typedef struct _XAnimCursor {
  168.     Cursor        cursor;
  169.     unsigned long   delay;
  170. } XAnimCursor;
  171.  
  172. typedef struct _XSpanFix {
  173.     XFixed        left, right, y;
  174. } XSpanFix;
  175.  
  176. typedef struct _XTrap {
  177.     XSpanFix        top, bottom;
  178. } XTrap;
  179.  
  180. _XFUNCPROTOBEGIN
  181.  
  182. Bool XRenderQueryExtension (Display *dpy, int *event_basep, int *error_basep);
  183.  
  184. Status XRenderQueryVersion (Display *dpy,
  185.                 int     *major_versionp,
  186.                 int     *minor_versionp);
  187.  
  188. Status XRenderQueryFormats (Display *dpy);
  189.  
  190. int XRenderQuerySubpixelOrder (Display *dpy, int screen);
  191.  
  192. Bool XRenderSetSubpixelOrder (Display *dpy, int screen, int subpixel);
  193.  
  194. XRenderPictFormat *
  195. XRenderFindVisualFormat (Display *dpy, _Xconst Visual *visual);
  196.  
  197. XRenderPictFormat *
  198. XRenderFindFormat (Display            *dpy,
  199.            unsigned long        mask,
  200.            _Xconst XRenderPictFormat    *templ,
  201.            int                count);
  202.     
  203. #define PictStandardARGB32  0
  204. #define PictStandardRGB24   1
  205. #define PictStandardA8        2
  206. #define PictStandardA4        3
  207. #define PictStandardA1        4
  208. #define PictStandardNUM        5
  209.  
  210. XRenderPictFormat *
  211. XRenderFindStandardFormat (Display        *dpy,
  212.                int            format);
  213.  
  214. XIndexValue *
  215. XRenderQueryPictIndexValues(Display            *dpy,
  216.                 _Xconst XRenderPictFormat    *format,
  217.                 int                *num);
  218.  
  219. Picture
  220. XRenderCreatePicture (Display                *dpy,
  221.               Drawable                drawable,
  222.               _Xconst XRenderPictFormat        *format,
  223.               unsigned long            valuemask,
  224.               _Xconst XRenderPictureAttributes    *attributes);
  225.  
  226. void
  227. XRenderChangePicture (Display                *dpy,
  228.               Picture                picture,
  229.               unsigned long            valuemask,
  230.               _Xconst XRenderPictureAttributes  *attributes);
  231.  
  232. void
  233. XRenderSetPictureClipRectangles (Display        *dpy,
  234.                  Picture        picture,
  235.                  int            xOrigin,
  236.                  int            yOrigin,
  237.                  _Xconst XRectangle *rects,
  238.                  int            n);
  239.  
  240. void
  241. XRenderSetPictureClipRegion (Display        *dpy,
  242.                  Picture        picture,
  243.                  Region        r);
  244.  
  245. void
  246. XRenderSetPictureTransform (Display        *dpy,
  247.                 Picture        picture,
  248.                 XTransform        *transform);
  249.  
  250. void
  251. XRenderFreePicture (Display                   *dpy,
  252.             Picture                   picture);
  253.  
  254. void
  255. XRenderComposite (Display   *dpy,
  256.           int        op,
  257.           Picture   src,
  258.           Picture   mask,
  259.           Picture   dst,
  260.           int        src_x,
  261.           int        src_y,
  262.           int        mask_x,
  263.           int        mask_y,
  264.           int        dst_x,
  265.           int        dst_y,
  266.           unsigned int    width,
  267.           unsigned int    height);
  268.  
  269. GlyphSet
  270. XRenderCreateGlyphSet (Display *dpy, _Xconst XRenderPictFormat *format);
  271.  
  272. GlyphSet
  273. XRenderReferenceGlyphSet (Display *dpy, GlyphSet existing);
  274.  
  275. void
  276. XRenderFreeGlyphSet (Display *dpy, GlyphSet glyphset);
  277.  
  278. void
  279. XRenderAddGlyphs (Display        *dpy,
  280.           GlyphSet        glyphset,
  281.           _Xconst Glyph        *gids,
  282.           _Xconst XGlyphInfo    *glyphs,
  283.           int            nglyphs,
  284.           _Xconst char        *images,
  285.           int            nbyte_images);
  286.  
  287. void
  288. XRenderFreeGlyphs (Display        *dpy,
  289.            GlyphSet        glyphset,
  290.            _Xconst Glyph    *gids,
  291.            int            nglyphs);
  292.  
  293. void
  294. XRenderCompositeString8 (Display            *dpy,
  295.              int                op,
  296.              Picture            src,
  297.              Picture            dst,
  298.              _Xconst XRenderPictFormat  *maskFormat,
  299.              GlyphSet            glyphset,
  300.              int                xSrc,
  301.              int                ySrc,
  302.              int                xDst,
  303.              int                yDst,
  304.              _Xconst char            *string,
  305.              int                nchar);
  306.  
  307. void
  308. XRenderCompositeString16 (Display            *dpy,
  309.               int                op,
  310.               Picture            src,
  311.               Picture            dst,
  312.               _Xconst XRenderPictFormat *maskFormat,
  313.               GlyphSet            glyphset,
  314.               int                xSrc,
  315.               int                ySrc,
  316.               int                xDst,
  317.               int                yDst,
  318.               _Xconst unsigned short    *string,
  319.               int                nchar);
  320.  
  321. void
  322. XRenderCompositeString32 (Display            *dpy,
  323.               int                op,
  324.               Picture            src,
  325.               Picture            dst,
  326.               _Xconst XRenderPictFormat *maskFormat,
  327.               GlyphSet            glyphset,
  328.               int                xSrc,
  329.               int                ySrc,
  330.               int                xDst,
  331.               int                yDst,
  332.               _Xconst unsigned int        *string,
  333.               int                nchar);
  334.  
  335. void
  336. XRenderCompositeText8 (Display                *dpy,
  337.                int                op,
  338.                Picture                src,
  339.                Picture                dst,
  340.                _Xconst XRenderPictFormat    *maskFormat,
  341.                int                xSrc,
  342.                int                ySrc,
  343.                int                xDst,
  344.                int                yDst,
  345.                _Xconst XGlyphElt8        *elts,
  346.                int                nelt);
  347.  
  348. void
  349. XRenderCompositeText16 (Display                *dpy,
  350.             int                op,
  351.             Picture                src,
  352.             Picture                dst,
  353.             _Xconst XRenderPictFormat   *maskFormat,
  354.             int                xSrc,
  355.             int                ySrc,
  356.             int                xDst,
  357.             int                yDst,
  358.             _Xconst XGlyphElt16        *elts,
  359.             int                nelt);
  360.  
  361. void
  362. XRenderCompositeText32 (Display                *dpy,
  363.             int                op,
  364.             Picture                src,
  365.             Picture                dst,
  366.             _Xconst XRenderPictFormat   *maskFormat,
  367.             int                xSrc,
  368.             int                ySrc,
  369.             int                xDst,
  370.             int                yDst,
  371.             _Xconst XGlyphElt32        *elts,
  372.             int                nelt);
  373.  
  374. void
  375. XRenderFillRectangle (Display            *dpy,
  376.               int            op,
  377.               Picture            dst,
  378.               _Xconst XRenderColor  *color,
  379.               int            x,
  380.               int            y,
  381.               unsigned int        width,
  382.               unsigned int        height);
  383.  
  384. void
  385. XRenderFillRectangles (Display            *dpy,
  386.                int            op,
  387.                Picture            dst,
  388.                _Xconst XRenderColor *color,
  389.                _Xconst XRectangle   *rectangles,
  390.                int            n_rects);
  391.  
  392. void
  393. XRenderCompositeTrapezoids (Display        *dpy,
  394.                 int            op,
  395.                 Picture        src,
  396.                 Picture        dst,
  397.                 _Xconst XRenderPictFormat    *maskFormat,
  398.                 int            xSrc,
  399.                 int            ySrc,
  400.                 _Xconst XTrapezoid    *traps,
  401.                 int            ntrap);
  402.  
  403. void
  404. XRenderCompositeTriangles (Display        *dpy,
  405.                int            op,
  406.                Picture        src,
  407.                Picture        dst,
  408.                 _Xconst XRenderPictFormat    *maskFormat,
  409.                int            xSrc,
  410.                int            ySrc,
  411.                _Xconst XTriangle    *triangles,
  412.                int            ntriangle);
  413.  
  414. void
  415. XRenderCompositeTriStrip (Display        *dpy,
  416.               int            op,
  417.               Picture        src,
  418.               Picture        dst,
  419.                 _Xconst XRenderPictFormat    *maskFormat,
  420.               int            xSrc,
  421.               int            ySrc,
  422.               _Xconst XPointFixed    *points,
  423.               int            npoint);
  424.  
  425. void
  426. XRenderCompositeTriFan (Display            *dpy,
  427.             int            op,
  428.             Picture            src,
  429.             Picture            dst,
  430.             _Xconst XRenderPictFormat    *maskFormat,
  431.             int            xSrc,
  432.             int            ySrc,
  433.             _Xconst XPointFixed    *points,
  434.             int            npoint);
  435.  
  436. void
  437. XRenderCompositeDoublePoly (Display            *dpy,
  438.                 int                op,
  439.                 Picture            src,
  440.                 Picture            dst,
  441.                 _Xconst XRenderPictFormat    *maskFormat,
  442.                 int                xSrc,
  443.                 int                ySrc,
  444.                 int                xDst,
  445.                 int                yDst,
  446.                 _Xconst XPointDouble    *fpoints,
  447.                 int                npoints,
  448.                 int                winding);
  449. Status
  450. XRenderParseColor(Display    *dpy, 
  451.           char        *spec,
  452.           XRenderColor    *def);
  453.  
  454. Cursor
  455. XRenderCreateCursor (Display        *dpy,
  456.              Picture        source,
  457.              unsigned int   x,
  458.              unsigned int   y);
  459.  
  460. XFilters *
  461. XRenderQueryFilters (Display *dpy, Drawable drawable);
  462.  
  463. void
  464. XRenderSetPictureFilter (Display    *dpy,
  465.              Picture    picture,
  466.              char        *filter,
  467.              XFixed        *params,
  468.              int        nparams);
  469.  
  470. Cursor
  471. XRenderCreateAnimCursor (Display    *dpy,
  472.              int        ncursor,
  473.              XAnimCursor    *cursors);
  474.  
  475.  
  476. void
  477. XRenderAddTraps (Display        *dpy,
  478.          Picture        picture,
  479.          int            xOff,
  480.          int            yOff,
  481.          _Xconst XTrap        *traps,
  482.          int            ntrap);
  483.  
  484. _XFUNCPROTOEND
  485.  
  486. #endif /* _XRENDER_H_ */
  487.